SECTION .text
BITS 16



GLOBAL kernel_start


kernel_start:	
	
protected:	
	cli
	lgdt [gdt_desc]		;load temp gdtr
	
	mov eax, cr0		;entry protected mode
	or  eax, 1
	mov cr0, eax

EXTERN entry
	call 0x08:entry

	
gdt_desc:
	dw gdt_end - gdt
	dd gdt


gdt:
	dd 0			;null segment
	dd 0

	dw 0xffff 		;code
	dw 0
	db 0
	db 0x9a
	db 0xcf
	db 0

	dw 0xffff		;data
	dw 0
	db 0
	db 0x92
	db 0xcf
	db 0

	dw 0xffff		;stack
	dw 0
	db 0
	db 0x92
	db 0xcf
	db 0

	dw 0xffff		;interrupt
	dw 0
	db 0
	db 0x9a
	db 0xcf
	db 0

gdt_end: